package cn.cangnova.model

import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement

/**
 * API 通用响应模型
 */
@Serializable
data class ApiResponse(
    val success: Boolean,
    val message: String,
    @Contextual
    val data: Any? = null
)

/**
 * 批量删除请求
 */
@Serializable
data class BulkDeleteRequest(
    val ids: List<String>
)

/**
 * 仪表盘数据模型
 */
@Serializable
data class DashboardData(
    val totalEvents: Int,
    val totalMetadata: Int,
    val recentMetadata: List<JsonElement>,
    val uniqueUsers: Int = 0,
    val systemStatus: SystemStatus = SystemStatus(),
    val todayNewEvents: Int = 0,
    val todayNewMetadata: Int = 0,
    val userGrowth: String = "+0%",
    val lastSyncTime: String = "",
    val recentActivities: List<Activity> = emptyList(),
    val weeklyGrowth: Double = 0.0,
    val monthlyActiveUsers: Double = 0.0
)

/**
 * 系统状态模型
 */
@Serializable
data class SystemStatus(
    val cpu: Int = 45,
    val memory: Int = 30,
    val disk: Int = 65,
    val status: String = "normal"
)

/**
 * 活动记录模型
 */
@Serializable
data class Activity(
    val title: String,
    val description: String,
    val time: String
)

/**
 * 元数据详情响应模型
 * 用于API返回单个元数据的详细信息
 */
@Serializable
data class MetadataDetailsResponse(
    val metadata: TelemetryMetadata,
    val formattedTime: String,
    val eventsCount: Int
) 